#include <QtOpenGL>
#include "sphere.h"
#include <GL/glu.h>

Sphere::Sphere(const QVector3D& center, QObject *parent):
    Object3D(center, parent)
{

   QDir d("../dojoQT/");

    program.addShaderFromSourceFile(QGLShader::Vertex,   d.absolutePath()+"/estrela.vert");
    program.addShaderFromSourceFile(QGLShader::Fragment, d.absolutePath()+"/estrela.frag");
    program.link();

}

void Sphere::drawGeometry(void)
{


  //  glScalef(0.5, 0.5, 0.5);

//    setColor(1,0,0);


       GLUquadric *quad = gluNewQuadric();

       gluQuadricDrawStyle(quad, GLU_FILL);
       gluQuadricNormals(quad, GLU_SMOOTH);

       gluQuadricTexture(quad, true);
   // program.bind();
       gluSphere(quad, 1, 30, 30);
    //   program.release();


}
